﻿using System;
using System.Collections.Generic;
using System.Text;
using IBLL.Controller;
using IBLL.View;

namespace BLL.Controller
{
    public abstract class ControllerBase : IFormController
    {
        #region IFormController 成员

        public abstract IViewForm View { get; set; }

        public abstract object PrimaryKey { get; set; }

        protected ControllerBase()
        {
        }

        public virtual void Close()
        {
            this.OnFinalization();
            this.View.OnClose();
        }

        public virtual void OnFinalization()
        {
            this.View.OnFinalization();
        }

        public virtual void OnInitialization()
        {
            this.View.OnInitialization();
        }

        public virtual void Show()
        {
            this.OnInitialization();
            this.View.OnShow();
        }



        #endregion





        #region IFormController 成员

        /// <summary>
        /// 界面刷新
        /// </summary>
        public abstract void Refresh(object sender, string id);
       

        #endregion
    }
}
